package demo;

public class Demo03 {
    public static void main(String[] args) {
        int sum=0;
        int ins=1;
        for (int i = 0; i <7 ; i=i+2) {
            sum=sum+ins*i;
            ins*=-1;
        }
        System.out.println("计算结果:"+sum);
    }

}

